package com.nlscan.qdkit.ui.publico.util;

import android.widget.EditText;

import java.util.Locale;

/**
 * <pre>
 *  author: lin.qing
 *  time  : 2023/3/30
 *  desc  :
 * </pre>
 */
public class RtlUtils {
    public static boolean isRTL() {
        return isRTL(Locale.getDefault());
    }

    public static boolean isRTL(Locale locale) {
        int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
        return directionality == 1 || directionality == 2;
    }

    public static void dealWithEdit(EditText... editTexts) {
        if (isRTL()) {
            EditText[] var1 = editTexts;
            int var2 = editTexts.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                EditText editText = var1[var3];
                editText.setGravity(21);
            }

        }
    }
}
